<%@ page import="njust.edu.entity.Trade" %>
<%@ page import="njust.edu.web.Page" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 陈
  Date: 2021/9/25
  Time: 15:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>管理员查看订单</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <meta charset="utf-8">
    <title></title>
    <style>
        p{
            font-family:georgia;
            font-weight: 500;
        }
        .header {
            font-size: 94%;
            opacity: 0.8;
            position: absolute;
            top: 0;
            width: 100%;
            height: 80px;
        }
        .header ul {
            list-style-type: none;
            background-color: #333;
            margin: 0;
            padding: 0;
            overflow: hidden;
            width: 100%;
            height: 80px;
        }

        .header li {
            float: left;
            height: 80px;
            width: 200px;
            font-size: 150%;
        }

        .header li a {
            display: block;
            color: white;
            text-align: center;
            padding: 30px;
            text-decoration: none;
            height: 80px;
        }
        .header li a:hover:not(.active) {
            background-color: #111;
        }
        .trade_choice {
            top: 0;
            width: 100%;
            height: 80px;
        }
        .trade_choice ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            overflow: hidden;
            width: 100%;
            height: 80px;
        }

        .trade_choice li {
            float: left;
            height: 80px;
            width: 200px;
            font-size: 140%;
        }

        .trade_choice li a {
            display: block;
            color: black;
            text-align: center;
            padding: 25px;
            text-decoration: none;
            height: 80px;
            border-style: solid;
            border-width: 5px;
            border-color: darkgrey;
        }
        .trade_choice li a:hover:not(.active) {
            background-color: lightgrey;
        }
        .container{
            position:absolute;
            width:1600px;
            height:1100px;
            top:80px;
            align-self: center;
            background-color: 	#F5FFFA;
            opacity: 0.8;
            border-radius: 45px/150px;
            left: 400px;
        }
        .navigate{
            position:relative;
            width:1500px;
            height:80px;
            left:50px;
            align-self: center;
            background-color: white;
        }
        .trade_choice{
            float: left;
            width: 450px;
            height: 80px;
            left: 0px;
            /* background-color: lightgreen; */
        }
        .search_tip{
            font-size: 150%;
            float: left;
            width: 440px;
            padding-top: 28px;
            padding-left: 320px;
            font-weight: 300;
            height: 80px;
            left: 0px;
            /* background-color: lightgreen; */
        }
        .search_choice{
            padding-top: 15px;
            padding-left: 0px;
            float: left;
            width: 200px;
            height: 80px;
            left: 0px;
            /* background-color: lightgreen; */
        }
        .search_text{
            float: left;
            width: 360px;
            height: 80px;
            left: 0px;
            /* background-color: lightgreen; */
            padding-top: 15px;
        }
        input[type=text] {
            width: 200px;
            box-sizing: border-box;
            border: 2px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
            background-color: white;
            background-image: url('https://static.runoob.com/images/mix/searchicon.png');
            background-position: 10px 10px;
            background-repeat: no-repeat;
            padding: 12px 20px 12px 40px;
            -webkit-transition: width 0.4s ease-in-out;
            transition: width 0.4s ease-in-out;
        }

        input[type=text]:focus {
            width:100%;
        }
        .catalogue{
            position:relative;
            width:1500px;
            height:80px;
            left:50px;
            align-self: center;
            padding-left: 8px;
            /*background-color: wheat;*/
        }
        .cart_cata{
            position: relative;
            float: left;
            height: 50px;
            top: 10px;
            /*background-color: white;*/
            margin-left: 20px;
            margin-right: 20px;
            padding-top: 15px;
            font-size: 150%;
            text-align: center;
        }
        .cart_list{
            position:relative;
            width:1500px;
            height:840px;
            left:50px;
            align-self: center;
            overflow: auto;
            /*background-color: white;*/
        }
        .cart_item{
            position:relative;
            width:1450px;
            height:60px;
            left:0px;
            align-self: center;
            overflow: auto;
            float: left;
            background-color: #cdd5ca;
            color: black;
            margin-top: 20px;
            font-size: 140%;
            border-radius: 40px;
        }
        .cart_info{
            position: relative;
            float: left;
            height: 50px;
            /*background-color: white;*/
            margin-left: 20px;
            margin-right: 20px;
            padding-top:10px;
            font-size: 120%;
            text-align: center;
        }
        .cart_pagination{
            position:relative;
            width:1500px;
            height:120px;
            left:50px;
            align-self: center;
            overflow: auto;
            /*background-color: white;*/
            font-size: 180%;
            padding-top: 10px;
            padding-left: 550px;
        }
        .page-link{
            border-style: none;
            outline: none;
        }
        select option{
            font-size: 110%;
        }
        #cata_cartid{
            width: 120px;
        }
        #cata_tableid{
            width: 80px;
        }
        #cata_cartstate{
            width:120px;
        }
        #cata_cartprice{
            width: 120px;
        }
        #cata_carttime{
            width: 300px;
        }
        #cata_username{
            width: 160px;
        }
        #cata_staffname{
            width: 160px;
        }
        #cart_id{
            width: 120px;
        }
        #table_id{
            width: 80px;
        }
        #cart_state{
            width: 120px;
        }
        #cart_price{
            width: 140px;
        }
        #cart_time{
            width: 300px;
        }
        #user_name{
            width: 160px;
        }
        #staff_name{
            width: 160px;
        }
        #item_searchchoise{
            width: 160px;
            padding: 16px 20px;
            border: none;
            border-radius: 4px;
            background-color: #f1f1f1;
            font-size: 120%;
            height: 50px;
            float: left;
        }
    </style>
</head>
<body>
<div class = "backGround" style="position: relative;">
    <img src = "../img/trade.jpg" width="2402px" height="1202px">
    <div class="header">
        <ul>
            <li><a href="BookController?method=itemManageUI"><p>管理菜品</p></a></li>
            <li><a href="TradeController?method=toTradeManageUI"><p>查看订单</p></a></li>
            <li><a href="UserController?method=toFinanceUI"><p>查看营业额</p></a></li>
            <li><a href="UserController?method=toSalaryUI" ><p>查看业绩</p></a></li>
            <li style="float: right"><a href="index.jsp" ><p>退出登录</p></a></li>
        </ul>
    </div>
<div class = "container">
    <div class = "navigate">
        <%
            Page<Trade> page_list = (Page<Trade>)request.getAttribute("page");
            List<Trade> trade_list = page_list.getList();
        %>
        <div class = "trade_choice">
            <ul>
                <li><a href="TradeController?method=toTradeManageUI" style="border-right-width: 0px;"><p>所有订单</p></a></li>
                <li><a href="TradeController?method=toTradeManageUI&state=<%=2%>"><p>未完成订单</p></a></li>
            </ul>
        </div>
        <div class = "search_tip"><p>查询订单:</p></div>
        <div class = "search_choice">
            <select id="item_searchchoise">
                <option value="" selected><p>订单号</p></option>
                <option value=""><p>桌号</p></option>
                <option value=""><p>用户名</p></option>
                <option value=""><p>下单时间</p></option>
                <option value=""><p>接单员工</p></option>
            </select>
        </div>
        <div class = "search_text">
            <input type="text" name="search" placeholder="搜索..">
        </div>
    </div>
    <div class = "catalogue">
        <div class = "cart_cata" id = "cata_cartid"><p>订单号</p></div>
        <div class = "cart_cata" id = "cata_tableid"><p>桌号</p></div>
        <div class = "cart_cata" id = "cata_username"><p>下单用户</p></div>
        <div class = "cart_cata" id = "cata_cartprice"><p>总价格</p></div>
        <div class = "cart_cata" id = "cata_carttime"><p>下单时间</p></div>
        <div class = "cart_cata" id = "cata_cartstate" style="margin-left: 30px"><p>订单状态</p></div>
        <div class = "cart_cata" id = "cata_staffname" style="margin-left: 25px"><p>接单员工ID</p></div>
    </div>
    <div class= "cart_list" >
        <%
            for(Trade trade:trade_list){
        %>
        <a href="TradeController?method=tradeManageInfo&tradeId=<%=trade.getId()%>" class = "cart_item" >
            <div class = "cart_info" id = "cart_id"><p><%=trade.getId()%></p></div>
            <div class = "cart_info" id = "table_id"><p><%=trade.getCustomer_table()%></p></div>
            <div class = "cart_info" id = "user_name"><p><%=trade.getUser().getName()%></p></div>
            <div class = "cart_info" id = "cart_price"><p><%=trade.getPrice()%>元</p></div>
            <div class = "cart_info" id = "cart_time"><p><%=trade.getDate()%></p></div>
            <div class = "cart_info" id = "cart_state"><p><%=trade.getState()==1?"等待接收":"已接收"%></p></div>
            <div class = "cart_info" id = "staff_name"><p><%=trade.getStaff_Id()%></p></div>
        </a>
        <%
            }
        %>
    </div>
    <div class = "cart_pagination">
        <ul class="pagination" style="border-style: none; outline: none; border-radius: 20px;">
            <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"
                                     href="TradeController?method=toTradeManageUI&pageNo=<%=(page_list.getPageNo()>1)?(page_list.getPageNo()-1):page_list.getPageNo()%>"><p>Previous</p></a></li>
            <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"><p>第 <%=page_list.getPageNo()%> 页 /</p></a></li>
            <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"><p>共 <%=page_list.getTotalPageNumber()%> 页</p></a></li>
            <li class="page-item"><a class="page-link" style="border-style: none; outline: none;"
                                     href="TradeController?method=toTradeManageUI&pageNo=<%=(page_list.getPageNo()<page_list.getTotalPageNumber())?(page_list.getPageNo()+1):page_list.getPageNo()%>"><p>Next</p></a></li>
        </ul>
    </div>
</div>
</div>
</body>


</html>

